package homework1;

import java.util.ArrayList;
import java.util.Scanner;

public class PrintlnNumber {
public static void main(String [] args) {
	ArrayList<Integer> a = new ArrayList<Integer>();
	ArrayList<Integer> count = new ArrayList<Integer>();
	int i=0,c=1;
	System.out.println("请输入1-100的整数，输入0代表输入完毕");
	all:
	while(true) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		for( int j=0;j<i;j++)
		{
			if(num==a.get(j))
			{
			count.set(j,count.get(j)+1);
			continue all;
			}
		}
		if(num==0)
			break;
		else
		{
		a.add(i,num);
		count.add(i,c);
		i++;
		}
	}
	for(int j=0;j<i;j++)
	{
		System.out.println(a.get(j)+"出现了"+count.get(j)+"次");
		
	}
}
}
